home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_4spiketrap.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  129 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_4spiketrap.cog
  4. #    
  5. # Pyramid 4 trap-door-and-spikes gag
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message        startup
  14. message        activated
  15. message        timer
  16.  
  17. # actors
  18. thing    player        nolink    local
  19.  
  20. # world things
  21. thing    trap        nolink
  22. thing    traphinge    nolink
  23. thing    button
  24.  
  25. # camera stuff
  26. thing    buttoncam    nolink
  27. thing    buttonlook    nolink
  28. thing    cam1spot    local
  29. thing    cam1look    local
  30.  
  31. # sound effects
  32. sound    flapdown=pyr_sarcophagus_lid.wav    local
  33. sound    flapup=teo_teobut_pull_c.wav        local
  34. sound    flapstop=gen_stone_stop_c.wav        local
  35.  
  36. # variables
  37. int        locked=0        local
  38.  
  39. # subroutines
  40. flex    fixcams=0.0        local
  41. end
  42.  
  43.  
  44. code
  45. startup:
  46.     SetThingLight(trap, '.1 .1 .2', .001, .01);
  47.  
  48.     return;
  49.  
  50. activated:
  51. # ---> button
  52.  
  53.     if (locked) return;
  54.     player = GetLocalPlayerThing();
  55.     
  56.     call fixcams;
  57.     if (MakeMeStop() == -1) return;
  58.     DeselectWeaponWait(player);
  59.  
  60.     locked = 1;
  61.     StartCutscene(0);
  62.     
  63.     # setup offset camera
  64.     cam1spot = CreateThing(GetThingTemplate(buttoncam), buttoncam);
  65.     cam1look = CreateThing(GetThingTemplate(buttoncam), buttoncam);
  66.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  67.     SetCameraLookInterp(2, 0);
  68.     SetCameraPosInterp(2, 0);
  69.     SetCameraFocus(2, cam1spot);
  70.     SetCameraSecondaryFocus(2, cam1look);
  71.     SetCurrentCamera(2);
  72.     ResetCameraFOV(0, 0.0);
  73.     SetCameraLookInterp(2, 1);
  74.     SetCameraPosInterp(2, 1);
  75.     SetCameraInterpSpeed(2, 0.7);
  76.     Sleep(0.01);
  77.     SetCameraFocus(2, buttoncam);
  78.     SetCameraSecondaryFocus(2, buttonlook);
  79.  
  80.     # indy activates
  81.     PlayMode(player, 60, 0);
  82.     Sleep(.25);
  83.     MoveToFrame(button, 1, 2);
  84.  
  85.     # move the trap up
  86.     PlaySoundThing(flapup, trap, 1, -1, -1, 0);
  87.     AttachThingToThing(trap, traphinge);
  88.     Rotate(traphinge, -90, 0, 2);    
  89.     WaitForStop(traphinge);
  90.     PlaySoundThing(flapstop, trap, 1, -1, -1, 0);
  91.     
  92.     # trap drops faster at higher difficulty
  93.     SetTimer(11 - GetDifficulty());
  94.     
  95.     Sleep(.7);
  96.  
  97.     # restore camera and get rid of objects
  98.     SetCameraLookInterp(2, 0);
  99.     SetCameraPosInterp(2, 0);
  100.     SetCameraPosition(1, GetThingPos(buttoncam));
  101.     SetCurrentCamera(1);
  102.     DestroyThing(cam1spot);
  103.     DestroyThing(cam1look);
  104.     
  105.     # finish up
  106.     call fixcams;
  107.     ClearActorFlags(player, 0x200000);
  108.     EndCutscene();
  109.     
  110.     return;
  111.     
  112. fixcams:
  113.     #reset camera settings
  114.     ResetCameraFOV(0, 0);
  115.     return;
  116.     
  117. timer:
  118.     #send trap back up, button back out
  119.     PlaySoundThing(flapdown, trap, 1, -1, -1, 0);
  120.     Rotate(traphinge, 90, 0, .5);
  121.     MoveToFrame(button, 0, 2);
  122.     WaitForStop(traphinge);
  123.     PlaySoundThing(flapstop, trap, 1, -1, -1, 0);
  124.     locked = 0;
  125.     return;
  126.     
  127. end
  128.  
  129.